added parent test and fixed a bug in parent