Converting statusmessage to a function object