fix #31 and update bash script