Some more error handling for db creation
move dbLock