changed permissions and cat instead of tail according to @motin