Add some exception handeling