Fixed Bug in IF-Statement for addMessage