added data validity check
fixed some bugs in rain alert