Was fixed by moving the javascript function calls to $(document),ready() in admin.js