was returning response before and not closing the connection