Database bug fixed