moved logic to post model