Fixed slight bug in using parent and child class.