Fixes Crash on Sleep