change comparison to direct instead of typeof