fixed some stupid bugs that made it crash instantly