Fixed bug in dispose function - and set some props null when disposed.
Added dispose function