Fixing missing return statement