fixed erroneous block ending