added message compile function