add indexing for layers
add indexing for layers