fixed alertMessageText generation function