Fixed bug of crashing when defocus