fix alerts running outside of angular context
clean up alerts controller