error in the script for creating the gender function