better exception handeling