Updated JS to fix position bug