Use intval here to not trust php and also use empty which gives more protections