Added check for Socket.IO onload