fixed 2 crash causing bugs