fixing fatal error with empty returns