fixed off by one mistake while encoding. Thankyou Mark Yoder :)