fixed minor bug due to code movement