socket.io emitting message to room does not work

Events binding for socket are moved to separate module:

exports.bind = function(socket) {
    socket.on('join', function(data) {
        socket.join(data.type);
    });
    socket.on('message', function(data) {
    global.io.sockets.in('rooma').emit('message', data);
    });
}

server.js:

var app = express();

//creating socket server
server = http.createServer(app);
io = global.io = require('socket.io').listen(server, {'log level': 3});

io.sockets.on('connection', function(socket) {
    //binding events on socket
    events.bind(socket, io);
});

The problem is, that message is never sent to the clients in 'rooma'. But if i emit it global:

global.io.sockets.emit('message', data);

It works. Where can be problem? I've tested the client belongs to room for sure.

this works when you get the initialisation of the event from the room to which you like to send your message:

exports.bind = function(socket) {
        socket.on('join', function(data) {
            socket.join(data.type);
        });
        socket.on('message', function(data) {
            socket.get('room', function (error, room) {
                io.sockets.in(room).emit('message', data);
            });
        });
    }