Fixed Database bug