Fixed so it will check if page type value is empty or not