Fix double messages when setting a class