fix inconsistent return statements