added handling of application messages