Fixed off by one error
Added exit info