add some debug for db queries
add loggedin to page params