fixed query bug and added mysql connection for insert new travel with table lock