Change the way of indexing into $theme

This solves the issue #5