fixed where statments with guard statements