Fixing bug , registering task