added if to check if page path is empty