bugfix in index and controller