moved all SQL queries into single Database module

Are you closing the connection?