Get-next is being called multiple times with next (-1)

As per the comment in one of the earlier post getting (-1) multiple times is not a problem as long as its being handled properly.

Please do let me know if I am missing something here.