added alerts & redirection