fix a bug in get alert function