Moved render and db to global variables