Added parameters to the prepare functions for the db queries