fixed some stuff with arrays