Reverted some parts of javascript