fixed the issue with the javascript stack, added validation to data model