Changed parameter type of checkFormat to string