fix panic bug