added safe flag