if-loop added