added condition to provide alert when no category is selected