Fix application logic