fixing automatic exit of SDL window bug