Fixed typo it is not NULL but it is -1 (not found)