added ajax safety