add funtion to write message to statusbar