add alert and loading