Few changes to fix deregister error