added interface and try catch