fixing sprite generation