fix some bugs in previous function
Merge branch 'master' of https://github.com/Nikki1993/BASe