fix for sjs
refactor