fix isset logic as mentioned by @britiger