fixed usage of optional type