Bug correction typeof returns string