added more changes to support MySQL