bugfix with indexOf problem