added if statement to determine if field is filled in