javascript now handles dynamic options