fixed sprite code