modified code to comply with API of node-mysql v2.x