implemented method save()