Proper handling of emit print_msg handling