debug statements removed  + real online detection added