use closure for the success method