Added message log function