added some logic code in manager