added validation to microposts model