fix end pos of 'main block'