I just discovered that while I am using custom post types and post meta fields the metadata dont get updated after submission. After second time submission it got updated. So what i did was i changed the
add_action('save_post', 'sitewide_tags_post', 10, 2); to
add_action('save_post', 'sitewide_tags_post', 100, 2);
I was wondering if this could affect anywhere else, if not i guess it would be good to implement into your code.