Fixed entity retrieving in case it's not needed