adding guards to stop html and php access in writable directories