Update index.js

Modified to handle booleans spefically.