improve crt-off function