move replace to inside isset