modified error reporting for php 5.4