Fixed bug for mysql db not working