fix panic error