fixed strange plot behaviour - needs to close figures