remove needless cast
add debug output on error
replace loading icon
add advanced options