Fix bug: error for calling undefined