autherisePost() function modified