Added is_numeric before intval