modified to add use spice
fix use_spice value
add loggin