replaced rewind() call with fseek() call

Added error testing from fseek() return value