adding if-else into resources script