now without any external dependencies and a few more lines ajax code