Fixed return statement bug