merge codes from master branch which contains some helpful bugfix