Removes extra code at the end