add ids and fix javascript