Added function for controlling sub page visibility