more robust error handeling