Fixed, I've added a condition to check if this is an ajax call, thank you.