bugfix in existance check, use "typeof"