added filter to save function