Program now doesn't crash