check if defined first