moved indexOf below other types checks