ADD: trying to add first type error detection. could be wrong?