Fixed typeof error