fixed bug, added dispose calls