Error correction in admin javascript