js for nested profiles