added parent and locking