modified js functions