fixed error that occured when 0 chars remaining