fixed bug with indexOf