Update function to handle html dirs