fix assignment to empty optional