fixing bugs in master branch