better error handeling (to test)