Added BASEPATH constant check in front of $file