fix javascript approval