take script from index.html to application.js; added checker - do not set parameter of model with empty strings