add loading states and event