Updated JS file for AMD