Fix for timestamps index out of bounds issue