Fix LogicException: 'You are not allowed to use js in #attached'.
Load exist entity insteads of creating new entity.
Add reference source test.