Fixed the bug

Crash on finish of work