fix sql query and provide setting to hide online status