Solved the problem with the conditions