fixed the crash - added retaining feature