tweaks to prevent php notices