works but javascript integration not perfect