hacky stuff for js db