Fixed Page Load Problems

There was an issue where when closing a database connection, the program
would crash. This is resolved and page breaks from the main screen
should be over with.