Move the checks to php