fixed a major bug in notification sending
changed the way main thread wait for http request thread