Some cleanup

bootstrap .modal not defined error solved by using document ready