Fix bug while getting step number.