allow set callback and environment together