Prevent random crashes