Updated getOnlinePlayers
Better error handling