fixing guard statements for unit tests to run properly