changed to prevent crash