added more logic code to manager