add some basic js validation