fixed a bug in the needs management