Fixed some bugs. Alert works now