updated array notation, exception and phpdoc
removed obsolete query sleep