fixing 'None' bug