move to index.js
check mandatory fields