fixed error with delegate