fixing alert message, dereferencing array