Fix e function and session function
Add dependency check