fixed issue #71 and udpate sql script