a more elegant way of using Try

Signed-off-by: Mikolaj Szabo <savingprivateblue@gmail.com>