Trying to fix crashes