fixed error where db not available