fix to  handle residues which are not closed with RESI 0