you should check for unsupported formats and throw an exception in this case