Added js logic