fix file serving logic, only index should be served