fixed lock exception on application close