added killed flag to be set on return