fixing bug in done method