added {} to if statements for better readibility

added {} missing after if and else statements to make the code more comprehendible and meet ideal php standards.