added @user_detail to index def