added length validation for posts