fix proper return for optional value