Fixed issues with if statements not triggering in process