Generalized Ulam-Hyers stability