bug fix, and add spinner directive