errors for undefined return value fixed