Added error if wrong format specified