fixed version to allow for versions without revision but has tag
removed accidentally added import
put closing reader and writer resources into finally