fixing alert variable not found