Add mainentry class for if loops