Crude fix to program crashing between blocks