some additional permission and error handling