Moving dependencies outside of function to ensure loading on client side