Add null check in case the server indices are not sequential