fix for rotating sometimes causing out of bounds exception