added exception handling to interface and implementation