Wait for document being ready before running JS