Reworked set current entity functionality