Added profileExists function