new js functions thanks to shani