check if class already exists in databse