fixed min and exit
fixed stuff