moved validation to index.js