added check for !empty in validate