I don't understand the logic here, why are you doing this check? Comments at minimum explaining the logic.