refactored echo to use tee to append to restricted file