partial fix of problem with out of bound code blocks