fix taskhandling in js