is.close() should be called before onCompleted() otherwise if it throws an exception it will call both onCompleted() followed by onFailure();