make sure entity is set before dispatch