updated permissions and clean up