throw better errors for wrong permissions

fixes #46