fixed wrong types implementation