Fixed error with databases