works in browser on client-side only