add spinner and fixing scheduling