Added function to get context element