Added error handling - updated interface