changed condition for setting source