fixed call methods on undefined