you should add some error handling for invalid formats