trying to fix issue with sweetalert