done with spinner
fixed if else error