fix bug: wrong syntax & improper logic
Merge branch 'dev'