added condition to wait until bufferedreader is ready. added content for 404 response