added validation in PostForm class