added validation to caption field