Resolve bug due to indent
Move script server side and update view