fixing some error output & don't create file before verifying it's a valid one