worked on dispose method