fix permissions and added a spec