Fixed issue with database connection going nil.