remove references to Promise
add logging for database errors
fix when being called wrong