use empty instead of isset, this way an empty string is also considered null