fixed Database errors