Fix Crash bugs