fixing capacity return type mismatch