Fixed conditional statements

Fixed all conditional statements for the application