custom logic modified