corrected memory leaks, added dealloc method in every class