Fixing crash, but isn't correct.