fixed addalert problem, and a few small things