adding some safe logic