JS Error logging return false