fixing bug related to block-ending