fixed small javascript issues