fix bug in process manager. need moooore tests