changed how spawn works, removed some errors