added user function to post model