modified js of orientation