added try except block around listen and accept, in order to continue when nothing there